import { baseUrlApi, requestClient, type Result } from '#/api/request';





/** 幻灯片列表 */
export const getYears = () => {
  return requestClient.get<Result>(baseUrlApi('/admin/year'));
};


/**
 * 添加幻灯片
 * @param data
 * @returns
 */
export const postYears = (data?: object) => {
    return requestClient.post<Result>(baseUrlApi('/admin/year'), data);
  };
  
  /**
   * 获取幻灯片信息
   * @param id
   * @returns
   */
  export const getYearsInfo = (id: number) => {
    return requestClient.get<Result>(baseUrlApi(`/admin/year/${id}`));
  };
  
  /**
   * 编辑幻灯片
   * @param id
   * @param data
   * @returns
   */
  export const putYears = (data?: any) => {
    return requestClient.put<Result>(
      baseUrlApi(`/admin/year/${data.id}`),
      data,
    );
  };
  
  /**
   * 删除幻灯片
   * @param id
   * @returns
   */
  export const deleteYear = (id: number) => {
    return requestClient.delete<Result>(baseUrlApi(`/admin/year/${id}`));
  };
  
